package com.briup.app02.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.briup.app02.bean.BaseRolePrivilege;
import com.briup.app02.bean.BaseRolePrivilegeExample;
import com.briup.app02.bean.BaseUserRoleExample;
import com.briup.app02.dao.BaseRolePrivilegeMapper;
import com.briup.app02.dao.BaseUserRoleMapper;
import com.briup.app02.service.IBaseRolePrivilegeService;

@Service
public class BaseRolePrivilegeService implements IBaseRolePrivilegeService{
	@Autowired
	private BaseRolePrivilegeMapper baseroloprivilegemapper;

	@Override
	public List<BaseRolePrivilege> findAll() {
		BaseRolePrivilegeExample example = new BaseRolePrivilegeExample();
		return baseroloprivilegemapper.selectByExample(example);
	}

	@Override
	public BaseRolePrivilege findById(long id) {
		return baseroloprivilegemapper.selectByPrimaryKey(id);
	}

	@Override
	public void saveOrUpdate(BaseRolePrivilege baseroleprivilege) {
		if(baseroleprivilege.getId() == null) {
			baseroloprivilegemapper.insert(baseroleprivilege);
		} else {
			baseroloprivilegemapper.updateByPrimaryKey(baseroleprivilege);
		}
	}

	@Override
	public void deleteById(long id) {
		baseroloprivilegemapper.deleteByPrimaryKey(id);
	}
	
}
